extends Node

static var now_draging_node = null

static func __putStr_Label(node:Label,text:String):
	node.text = text

static func __dragging_(event:InputEvent,node) -> bool: #把事件传输进去，然后把要跟着鼠标移动的东西传过去，返回是否拖拽了
	if __should_dragging_(event,node):
		node.position += event.get_relative()
		now_draging_node = node
		return true
	now_draging_node = null
	return false
	
static func __should_dragging_(event:InputEvent,node) -> bool:
	if not node.dragging:
		node.justdrag = false
	if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT:
		if (event.position - node.position) != Vector2.ZERO:
			if not node.dragging and event.pressed:
				node.dragging = true
		if node.dragging and not event.pressed:
			node.dragging = false
	if node.dragging and event is InputEventMouseMotion:
		node.justdrag = true
		return true
	return false
	
static func __By_select(event: InputEvent,node,__Play_pos_now_Animation:Callable) -> void:
	var Anode:AnimationPlayer = node.get_node("AnimationPlayer")
	if not node.justdrag and event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.is_released():
		if not node.select:
			__Play_pos_now_Animation.call(node,Anode,"up")
			node.select = true
		else:
			__Play_pos_now_Animation.call(node,Anode,"down")
			node.select = false
